﻿// ===============================================================================
// ILogger.cs
// EOS Framework
// ===============================================================================
// Copyright (c) EOS Development Group. All rights reserved.
// ===============================================================================

namespace EOS.Framework.Contracts.Logger
{
    using System;

    /// <summary>
    /// Contract for all loggers.
    /// </summary>
    public interface ILogger
    {
        /// <summary>
        /// Initializes the logger with specified consumer type.
        /// </summary>
        /// <param name="consumerType">Type of the consumer. Cannot be null.</param>
        /// <exception cref="ArgumentNullException"><paramref name="consumerType"/> is 
        /// null (Nothing in Visual Basic).</exception>
        void Initialize(Type consumerType);

        /// <summary>
        /// Loggs a debug message.
        /// </summary>
        /// <param name="message">The debug message. Cannot be null or empty or contains only blanks.</param>
        /// <param name="args">A array of arguments.</param>
        /// <exception cref="ArgumentNullException"><paramref name="message"/> is null
        /// (Nothing in Visual Basic).</exception>
        /// <exception cref="ArgumentException"><paramref name="message"/> is a string
        /// of length 0 or contains only blanks.</exception>
        /// <exception cref="InvalidOperationException">Logger is not initialized.</exception>
        void LogDebug(string message, params object[] args);

        /// <summary>
        /// Loggs a debug message by using the specified <see cref="IFormatProvider"/>.
        /// </summary>
        /// <param name="formatProvider">An <see cref="IFormatProvider"/> that supplies culture-specific formatting information.</param>
        /// <param name="message">The debug message. Cannot be null or empty or contains only blanks.</param>
        /// <param name="args">A array of arguments.</param>
        /// <exception cref="ArgumentNullException"><paramref name="message"/> is null
        /// (Nothing in Visual Basic).</exception>
        /// <exception cref="ArgumentException"><paramref name="message"/> is a string
        /// of length 0 or contains only blanks.</exception>
        /// <exception cref="InvalidOperationException">Logger is not initialized.</exception>
        void LogDebug(IFormatProvider formatProvider, string message, params string[] args);

        /// <summary>
        /// Loggs a warning message.
        /// </summary>
        /// <param name="message">The warning message. Cannot be null or empty or contains only blanks.</param>
        /// <param name="args">A array of arguments.</param>
        /// <exception cref="ArgumentNullException"><paramref name="message"/> is null
        /// (Nothing in Visual Basic).</exception>
        /// <exception cref="ArgumentException"><paramref name="message"/> is a string
        /// of length 0 or contains only blanks.</exception>
        /// <exception cref="InvalidOperationException">Logger is not initialized.</exception>
        void LogWarn(string message, params object[] args);

        /// <summary>
        /// Loggs a warning message by using the specified <see cref="IFormatProvider"/>.
        /// </summary>
        /// <param name="formatProvider">An <see cref="IFormatProvider"/> that supplies culture-specific formatting information.</param>
        /// <param name="message">The warning message. Cannot be null or empty or contains only blanks.</param>
        /// <param name="args">A array of arguments.</param>
        /// <exception cref="ArgumentNullException"><paramref name="message"/> is null
        /// (Nothing in Visual Basic).</exception>
        /// <exception cref="ArgumentException"><paramref name="message"/> is a string
        /// of length 0 or contains only blanks.</exception>
        /// <exception cref="InvalidOperationException">Logger is not initialized.</exception>
        void LogWarn(IFormatProvider formatProvider, string message, params string[] args);

        /// <summary>
        /// Loggs a fatal error message.
        /// </summary>
        /// <param name="message">The fatal error message. Cannot be null or empty or contains only blanks.</param>
        /// <param name="args">A array of arguments.</param>
        /// <exception cref="ArgumentNullException"><paramref name="message"/> is null
        /// (Nothing in Visual Basic).</exception>
        /// <exception cref="ArgumentException"><paramref name="message"/> is a string
        /// of length 0 or contains only blanks.</exception>
        /// <exception cref="InvalidOperationException">Logger is not initialized.</exception>
        void LogFatal(string message, params object[] args);

        /// <summary>
        /// Loggs a fatal error message by using the specified <see cref="IFormatProvider"/>.
        /// </summary>
        /// <param name="formatProvider">An <see cref="IFormatProvider"/> that supplies culture-specific formatting information.</param>
        /// <param name="message">The fatal error message. Cannot be null or empty or contains only blanks.</param>
        /// <param name="args">A array of arguments.</param>
        /// <exception cref="ArgumentNullException"><paramref name="message"/> is null
        /// (Nothing in Visual Basic).</exception>
        /// <exception cref="ArgumentException"><paramref name="message"/> is a string
        /// of length 0 or contains only blanks.</exception>
        /// <exception cref="InvalidOperationException">Logger is not initialized.</exception>
        void LogFatal(IFormatProvider formatProvider, string message, params string[] args);

        /// <summary>
        /// Loggs an error message.
        /// </summary>
        /// <param name="message">The error message. Cannot be null or empty or contains only blanks.</param>
        /// <param name="args">A array of arguments.</param>
        /// <exception cref="ArgumentNullException"><paramref name="message"/> is null
        /// (Nothing in Visual Basic).</exception>
        /// <exception cref="ArgumentException"><paramref name="message"/> is a string
        /// of length 0 or contains only blanks.</exception>
        /// <exception cref="InvalidOperationException">Logger is not initialized.</exception>
        void LogError(string message, params object[] args);

        /// <summary>
        /// Loggs a error message by using the specified <see cref="IFormatProvider"/>.
        /// </summary>
        /// <param name="formatProvider">An <see cref="IFormatProvider"/> that supplies culture-specific formatting information.</param>
        /// <param name="message">The error message. Cannot be null or empty or contains only blanks.</param>
        /// <param name="args">A array of arguments.</param>
        /// <exception cref="ArgumentNullException"><paramref name="message"/> is null
        /// (Nothing in Visual Basic).</exception>
        /// <exception cref="ArgumentException"><paramref name="message"/> is a string
        /// of length 0 or contains only blanks.</exception>
        /// <exception cref="InvalidOperationException">Logger is not initialized.</exception>
        void LogError(IFormatProvider formatProvider, string message, params string[] args);
    }
}
